using TMPro;
using UnityEngine;
using UnityEngine.UI;
using Voodoo.Pattern;

public class UpgradeOption : MonoBehaviour
{
	public GameObject RVBanner;

	public GameObject SelectedImage;

	public Image Icon;

	public TextMeshProUGUI TitleText;

	public TextMeshProUGUI DescriptionText;

	private DuelUpgrade upgrade;

	public Button SelectButton;

	internal void Fill(DuelUpgrade duelUpgrade)
	{
		SelectButton.interactable = true;
		RVBanner.SetActive(duelUpgrade.RV);
		SelectedImage.SetActive(value: false);
		Icon.sprite = duelUpgrade.Icon;
		TitleText.text = duelUpgrade.Title;
		DescriptionText.text = duelUpgrade.Description;
		upgrade = duelUpgrade;
	}

	public void SelectUpgrade()
	{
		if (upgrade.RV)
		{
			SingletonMB<DuelModeManager>.Instance.SelectUpgrade(isPlayer: true, upgrade);
		}
		else
		{
			SingletonMB<DuelModeManager>.Instance.SelectUpgrade(isPlayer: true, upgrade);
		}
	}

	internal void SetAsSelected()
	{
		SelectButton.interactable = false;
		SelectedImage.SetActive(value: true);
		SingletonMB<DuelModeManager>.Instance.SelectUpgrade(isPlayer: false, upgrade);
	}
}
